﻿function myChestAll(){
			//document.getElementById("allofmyshareid").className="myfriend_friendactivity_content_right_select_myshare";
			//$("#moneyall").addClass('myfriend_friendactivity_content_right_select_mymoney2');
			//$("#friendall").addClass('myfriend_friendactivity_content_right_select_myfriend2');
			
	document.getElementById("myDesignTable").style.display="none";
	document.getElementById("myOrderTable").style.display="none";
	$(".shoppingCar_subtitle").hide();
	
			$("#friend_content_right").html("");
			$("#friend_content_right").html("<span style='float: left' class=''><a href='javascript:void(0)' onclick='share()'> <font  id='sharefont'>分享收入</font></a>(<span id='sharemoney'></span>元)</span>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<span style='float: right;'><a href='javascript:void(0);' onclick='cost()'><font id='costfont'>消费支出</font></a>（<span id='costmoney'></span>元）</span><br><br>");
			$("#friend_content_right").append("<div id='shareall'>"+"</div>");
			$("#friend_content_right").append("<div id='costall' style='display:none;'></div>");
			$("#shareall").html("<div style='background-color:#FAFAD2;'><span style='float:left'>分享主题 </span><span style='float:center'>分享金额 </span><span style='float:right'>获得时间 </span></div>");
			$("#costall").html("<div style='background-color:#FAFAD2;'><span style='float:left'>消费主题 </span><span style='float:center'>消费金额 </span><span style='float:right'>消费时间 </span></div>");
			$("#sharefont").css("color","red");
			$.getJSON('ChestAction!twoListfind.action',function(data){
					if(data.commission.length>0){
						for(var i=0;i<data.commission.length;i++){
							$("#shareall").append("<div style='height:70px; background-color:#cccccc;'><span style='float:left;'>"+"<img src="+data.commission[i].customPic+" width='70px' height='70px' padding-top: 0px;/></span>"+"<span style='float:center'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+data.commission[i].getMoney +"</span><span style='float:right'>"+newData(data.commission[i].commissionTime)+"</span></div><br/>");
						}
					}
					if(data.commissionfromcustom.length>0){
						for(var i=0;i<data.commissionfromcustom.length;i++){
						$("#shareall").append("<div style='height:70px; background-color:#cccccc;'><span style='float:left;'>"+"<img src="+data.commission[i].customPic+" width='70px' height='70px' padding-top: 0px;/></span>"+"<span style='float:center'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+data.commission[i].getMoney +"</span><span style='float:right'>"+newData(data.commission[i].commissionTime)+"</span></div>");
						}
					}
					if(data.commission.length+data.commissionfromcustom.length<0){
						$("#shareall").append("还没有任何的收入");
					}
					$("#sharemoney").html(data.commissionAllMoney);
					if(data.custom.length>0){
						for(var j=0;j<data.custom.length;j++){
							$("#costall").append("<div style='height:70px;  background-color:#cccccc;'><span style='float:left;'>"+"<img src="+data.custom[j].orderPic+" width='70px' height='70px' padding-top: 0px;/></span>"+"<span style='float:center'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+data.custom[j].orderTotalPrice+"</span><span style='float:right'>"+newData(data.custom[j].orderTime)+"</span></div>");
						}
					}else{
						$("#costall").append("没有任何的支出");
					}
					$("#costmoney").html(data.customAllMoney);
			});
		}
		 function cost(){
			document.getElementById("costall").style.display="";
			document.getElementById("shareall").style.display="none";
			$("#costfont").css("color","red");
			$("#sharefont").css("color","");
		}
		 
		 function share(){
				document.getElementById("shareall").style.display="";
				document.getElementById("costall").style.display="none";
				$("#sharefont").css("color","red");
				$("#costfont").css("color","");
			}
		 function newData(d){
				var i=d.indexOf("T");
				var str=" "+d.substr(0,i)+" "+d.substr(i+1,d.length);
				return str;
				
			}
		 
		 